public class Account {

    private String cardID;
    private double money;

    public Account() {
    }

    public Account(String cardID, double money) {
        this.cardID = cardID;
        this.money = money;
    }

    public void drawMoney(double money) {
        //  获取当前取钱人的名称
        String name = Thread.currentThread().getName();
        // 判断当前账户余额是否足够
        if (this.money >= money) {
            // 余额充足，开始取钱
            System.out.println(name + "来取钱" + money + "成功！");
            this.money -= money;
            System.out.println(name + "来取钱后，余额剩余：" + this.money);
        } else {
            // 余额不足
            System.out.println(name + "来取钱：余额不足~");
        }
    }

    public String getCardID() {
        return cardID;
    }

    public void setCardID(String cardID) {
        this.cardID = cardID;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }
}
